<template>
	<view class="beijingse">
		<view class="ffffff mainpadding flexbetween">
			<view class="flexleft shangbj">
				<image class="toxuia margin_right2" :src="dataAll.avatar_text" mode=""></image>
				<view class="">
					<view class="flexleft">
						<view class="sanshier fonweight xiaohei margin_right1">{{dataAll.nickname}}</view>
						<view class="biaoq flexcenter">{{dataAll.cj_text}}</view>
					</view>
					<view class="ershiba xiaohui margin_top1">{{dataAll.mobile}}</view>
				</view>
			</view>
			<view class="">
				<view class="flexleft">
					<image class="jinb margin_right1" src="../static/image/system/jb.png" mode=""></image>
					<view class="fonweight xiaohei" style="font-size: 44rpx;">{{dataAll.total_yj_price}}</view>
				</view>
				<view class="strongtext xiaohei textright">累计收益</view>
			</view>
		</view>
		<!-- 流水 -->
		<view class="mainpadding" v-if="list.total">
			<view class="mainpadding radius  ffffff">
				<view class="xiahuaxian shangbj1 flexbetween" v-for="item in list.data" :key="item.id">
					<view class="">
						<view class="strongtext xiaohui">{{item.createtime_text}}</view>
						<view class="ershiba xiaohei fonweight margin_top2">{{item.memo}}</view>
					</view>
					<view class="bigtext xiaohei fonweight ">{{item.money}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid:"",
				dataAll:{},
				page: 1,
				limit: 10,
				list: {
					data: []
				}
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.getinfo()
			this.init()
		},
		methods: {
			getinfo() {
				httpRequest.request('/api/user/teamInfo', 'GET', {
					id:this.listid
				}).then(res => {
					this.dataAll = res.data
					console.log(res.data);
				}).catch(err => {
				})
			},
			init(isPage, page) {
				let _this = this
				let url = "/api/user/teamInfoMoneyLog"
				let data = {
					page: page || 1,
					limit: _this.limit,
					user_id: this.listid
				}
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.xiahuaxian:last-child{
		padding-bottom: 0;
		border: none;
	}
	.jinb{
		width: 32rpx;
		height: 32rpx;
	}
	.biaoq {
		width: 65rpx;
		height: 32rpx;
		font-size: 20rpx;
		font-family: Source Han Sans CN, Source Han Sans CN;
		font-weight: 400;
		color: #2361FF;
		border: 1rpx solid #2361FF;
		border-radius: 20rpx;
	}
	
	.toxuia {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
	}
.shangbj {
		margin-top: 30rpx;
	}

	.shangbj:first-child {
		margin-top: 0rpx;
	}
	.shangbj1 {
			margin-top: 30rpx;
		}
	
		.shangbj1:first-child {
			margin-top: 0rpx;
		}
</style>
